<section id="content">
<script type="text/javascript">
		function func_back(){
			$("#hidIsBack").val("y");
			var confirmType = $("#hidConfirmType").val();
			if(confirmType == 'insert'){
		   		$("#main_form").prop("action", "inputSubject");
			}else{
				$("#main_form").prop("action", "editSubject");
			}
		   	return $("#main_form").submit();
		}

   </script>

<form id="main_form" method="post"
	action="registSubject?type=<?php echo $confirmType;?>">
	<input type="hidden" id="hidIsBack" value="" name="isBack"/>
	<input type="hidden" id="hidConfirmType" name="confirmType" value="<?php echo $confirmType;?>"/>
	<?php if($confirmType != "insert"){ ?>
	<input type="hidden" id="hidSubId" name="subId" value="<?php echo $subId; ?>" />
	<?php }?>
	<input type="hidden" name="videoId" id="txtVideoId" value="<?php echo $videoId; ?>" />
	<input type="hidden" name="imageName" id="hidImageName" value="<?php echo $fileName; ?>" />
	<input type="hidden" name="subName" id="txtSubName" value="<?php echo $subName;?>" />
	<input type="hidden" name="subDescript" id="txtSubDescript" value="<?php echo $subDescript ;?>" />
	<input type="hidden" name="oldSubName" value="<?php echo isset($oldSubName) ? $oldSubName : "";?>" />
	<input type="hidden" name="isFileChange" value="<?php echo $fileChange; ?>" />
	<input type="hidden" name="subFee" value="<?php echo $subFee; ?>" />
	
	<?php if (isset($subOldImage)){
		echo '<input type="hidden" name="subOldImage" value="'.$subOldImage.'"/>';
	}?>

	<?php if($confirmType == "insert"){ ?>
	<center>
		<H1>Tạo mới môn học</H1>
	</center>
	<?php } else { ?>
	<center>
		<H1>Cập nhật môn học</H1>
	</center>
	<?php } ?>
	<table id="edit_table">
		<tr>
			<td class="edit_column" width="170">Môn học</td>
			<td style="text-align: left;"><?php echo $subName; ?></td>
		</tr>
		
		<tr>
			<td class="edit_column" width="170">Học phí</td>
			<td style="text-align: left;"><?php echo $subFee; ?> VNĐ</td>
		</tr>
		
		<tr>
			<td class="edit_column">Mã Video</td>
			<td><?php echo $videoId; ?></td>
		</tr>
		<tr>
			<td class="edit_column">Hình đại diện</td>
			<td><?php echo $fileName; ?></td>
		</tr>
		<tr>
			<td class="edit_column" style="vertical-align: top;">Mô tả môn học</td>
			<td style="text-align: left;"><textarea disabled name="subDescript"
					style="width: 97%;" rows="20"><?php echo $subDescript; ?></textarea>
			</td>
		</tr>
		<tr>
			<td colspan="2" style="text-align: center;">
				<button type="submit">Hoàn Tất</buton>
				<button type="button" onclick="func_back()" style="margin-left: 10px;">Quay Lại</button>
			</td>
		</tr>
	</table>
</form>
</section>

